package com.openbravo.pos.thirdparties;

import com.openbravo.basic.BasicException;
import com.openbravo.data.user.DirtyManager;
import com.openbravo.data.user.EditorRecord;
import com.openbravo.pos.forms.AppView;
import java.awt.Color;
import java.awt.Component;
import java.util.UUID;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.Document;

public class ThirdPartiesView extends JPanel
  implements EditorRecord
{
  private Object m_oId;
  private JLabel jLabel10;
  private JLabel jLabel11;
  private JLabel jLabel12;
  private JLabel jLabel13;
  private JLabel jLabel14;
  private JLabel jLabel15;
  private JLabel jLabel16;
  private JLabel jLabel2;
  private JLabel jLabel3;
  private JLabel jLabel4;
  private JLabel jLabel5;
  private JLabel jLabel6;
  private JLabel jLabel7;
  private JLabel jLabel8;
  private JLabel jLabel9;
  private JScrollPane jScrollPane1;
  private JScrollPane jScrollPane2;
  private JTextArea m_jAddress;
  private JTextField m_jCIF;
  private JTextField m_jContactComm;
  private JTextField m_jContactFact;
  private JTextField m_jEMail;
  private JTextField m_jFaxNumber;
  private JTextField m_jMobileNumber;
  private JTextField m_jName;
  private JTextArea m_jNotes;
  private JTextField m_jPayRule;
  private JTextField m_jPhoneNumber;
  private JTextField m_jWebPage;

  public ThirdPartiesView(AppView paramAppView, DirtyManager paramDirtyManager)
  {
    initComponents();
    this.m_jCIF.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jName.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jAddress.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jContactComm.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jContactFact.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jPayRule.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jFaxNumber.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jPhoneNumber.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jMobileNumber.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jEMail.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jWebPage.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jNotes.getDocument().addDocumentListener(paramDirtyManager);
    writeValueEOF();
  }

  public void writeValueEOF()
  {
    this.m_oId = null;
    this.m_jCIF.setText(null);
    this.m_jName.setText(null);
    this.m_jAddress.setText(null);
    this.m_jContactComm.setText(null);
    this.m_jContactFact.setText(null);
    this.m_jPayRule.setText(null);
    this.m_jFaxNumber.setText(null);
    this.m_jPhoneNumber.setText(null);
    this.m_jMobileNumber.setText(null);
    this.m_jEMail.setText(null);
    this.m_jWebPage.setText(null);
    this.m_jNotes.setText(null);
    this.m_jCIF.setEnabled(false);
    this.m_jName.setEnabled(false);
    this.m_jAddress.setEnabled(false);
    this.m_jContactComm.setEnabled(false);
    this.m_jContactFact.setEnabled(false);
    this.m_jPayRule.setEnabled(false);
    this.m_jFaxNumber.setEnabled(false);
    this.m_jPhoneNumber.setEnabled(false);
    this.m_jMobileNumber.setEnabled(false);
    this.m_jEMail.setEnabled(false);
    this.m_jWebPage.setEnabled(false);
    this.m_jNotes.setEnabled(false);
  }

  public void writeValueInsert()
  {
    this.m_oId = null;
    this.m_jCIF.setText(null);
    this.m_jName.setText(null);
    this.m_jAddress.setText(null);
    this.m_jContactComm.setText(null);
    this.m_jContactFact.setText(null);
    this.m_jPayRule.setText(null);
    this.m_jFaxNumber.setText(null);
    this.m_jPhoneNumber.setText(null);
    this.m_jMobileNumber.setText(null);
    this.m_jEMail.setText(null);
    this.m_jWebPage.setText(null);
    this.m_jNotes.setText(null);
    this.m_jCIF.setEnabled(true);
    this.m_jName.setEnabled(true);
    this.m_jAddress.setEnabled(true);
    this.m_jContactComm.setEnabled(true);
    this.m_jContactFact.setEnabled(true);
    this.m_jPayRule.setEnabled(true);
    this.m_jFaxNumber.setEnabled(true);
    this.m_jPhoneNumber.setEnabled(true);
    this.m_jMobileNumber.setEnabled(true);
    this.m_jEMail.setEnabled(true);
    this.m_jWebPage.setEnabled(true);
    this.m_jNotes.setEnabled(true);
  }

  public void writeValueDelete(Object paramObject)
  {
    Object[] arrayOfObject = (Object[])(Object[])paramObject;
    this.m_oId = arrayOfObject[0];
    this.m_jCIF.setText((String)arrayOfObject[1]);
    this.m_jName.setText((String)arrayOfObject[2]);
    this.m_jAddress.setText((String)arrayOfObject[3]);
    this.m_jContactComm.setText((String)arrayOfObject[4]);
    this.m_jContactFact.setText((String)arrayOfObject[5]);
    this.m_jPayRule.setText((String)arrayOfObject[6]);
    this.m_jFaxNumber.setText((String)arrayOfObject[7]);
    this.m_jPhoneNumber.setText((String)arrayOfObject[8]);
    this.m_jMobileNumber.setText((String)arrayOfObject[9]);
    this.m_jEMail.setText((String)arrayOfObject[10]);
    this.m_jWebPage.setText((String)arrayOfObject[11]);
    this.m_jNotes.setText((String)arrayOfObject[12]);
    this.m_jCIF.setEnabled(false);
    this.m_jName.setEnabled(false);
    this.m_jAddress.setEnabled(false);
    this.m_jContactComm.setEnabled(false);
    this.m_jContactFact.setEnabled(false);
    this.m_jPayRule.setEnabled(false);
    this.m_jFaxNumber.setEnabled(false);
    this.m_jPhoneNumber.setEnabled(false);
    this.m_jMobileNumber.setEnabled(false);
    this.m_jEMail.setEnabled(false);
    this.m_jWebPage.setEnabled(false);
    this.m_jNotes.setEnabled(false);
  }

  public void writeValueEdit(Object paramObject)
  {
    Object[] arrayOfObject = (Object[])(Object[])paramObject;
    this.m_oId = arrayOfObject[0];
    this.m_jCIF.setText((String)arrayOfObject[1]);
    this.m_jName.setText((String)arrayOfObject[2]);
    this.m_jAddress.setText((String)arrayOfObject[3]);
    this.m_jContactComm.setText((String)arrayOfObject[4]);
    this.m_jContactFact.setText((String)arrayOfObject[5]);
    this.m_jPayRule.setText((String)arrayOfObject[6]);
    this.m_jFaxNumber.setText((String)arrayOfObject[7]);
    this.m_jPhoneNumber.setText((String)arrayOfObject[8]);
    this.m_jMobileNumber.setText((String)arrayOfObject[9]);
    this.m_jEMail.setText((String)arrayOfObject[10]);
    this.m_jWebPage.setText((String)arrayOfObject[11]);
    this.m_jNotes.setText((String)arrayOfObject[12]);
    this.m_jCIF.setEnabled(true);
    this.m_jName.setEnabled(true);
    this.m_jAddress.setEnabled(true);
    this.m_jContactComm.setEnabled(true);
    this.m_jContactFact.setEnabled(true);
    this.m_jPayRule.setEnabled(true);
    this.m_jFaxNumber.setEnabled(true);
    this.m_jPhoneNumber.setEnabled(true);
    this.m_jMobileNumber.setEnabled(true);
    this.m_jEMail.setEnabled(true);
    this.m_jWebPage.setEnabled(true);
    this.m_jNotes.setEnabled(true);
  }

  public Object createValue()
    throws BasicException
  {
    Object[] arrayOfObject = new Object[13];
    arrayOfObject[0] = (this.m_oId == null ? UUID.randomUUID().toString() : this.m_oId);
    arrayOfObject[1] = this.m_jCIF.getText();
    arrayOfObject[2] = this.m_jName.getText();
    arrayOfObject[3] = this.m_jAddress.getText();
    arrayOfObject[4] = this.m_jContactComm.getText();
    arrayOfObject[5] = this.m_jContactFact.getText();
    arrayOfObject[6] = this.m_jPayRule.getText();
    arrayOfObject[7] = this.m_jFaxNumber.getText();
    arrayOfObject[8] = this.m_jPhoneNumber.getText();
    arrayOfObject[9] = this.m_jMobileNumber.getText();
    arrayOfObject[10] = this.m_jEMail.getText();
    arrayOfObject[11] = this.m_jWebPage.getText();
    arrayOfObject[12] = this.m_jNotes.getText();
    return arrayOfObject;
  }

  public Component getComponent()
  {
    return this;
  }

  public void refresh()
  {
  }

  private void initComponents()
  {
    this.jLabel2 = new JLabel();
    this.m_jCIF = new JTextField();
    this.jLabel3 = new JLabel();
    this.m_jName = new JTextField();
    this.jLabel4 = new JLabel();
    this.m_jContactComm = new JTextField();
    this.jLabel5 = new JLabel();
    this.m_jContactFact = new JTextField();
    this.jLabel6 = new JLabel();
    this.m_jPayRule = new JTextField();
    this.jLabel7 = new JLabel();
    this.m_jFaxNumber = new JTextField();
    this.jLabel8 = new JLabel();
    this.m_jPhoneNumber = new JTextField();
    this.jLabel9 = new JLabel();
    this.m_jMobileNumber = new JTextField();
    this.jLabel10 = new JLabel();
    this.m_jEMail = new JTextField();
    this.jLabel11 = new JLabel();
    this.m_jWebPage = new JTextField();
    this.jLabel12 = new JLabel();
    this.jLabel13 = new JLabel();
    this.jScrollPane1 = new JScrollPane();
    this.m_jNotes = new JTextArea();
    this.jScrollPane2 = new JScrollPane();
    this.m_jAddress = new JTextArea();
    this.jLabel14 = new JLabel();
    this.jLabel15 = new JLabel();
    this.jLabel16 = new JLabel();
    setLayout(null);
    this.jLabel2.setText("CIF");
    add(this.jLabel2);
    this.jLabel2.setBounds(20, 20, 90, 15);
    add(this.m_jCIF);
    this.m_jCIF.setBounds(110, 20, 270, 19);
    this.jLabel3.setText("Nombre");
    add(this.jLabel3);
    this.jLabel3.setBounds(20, 50, 90, 15);
    add(this.m_jName);
    this.m_jName.setBounds(110, 50, 270, 19);
    this.jLabel4.setText("Comercial");
    add(this.jLabel4);
    this.jLabel4.setBounds(20, 190, 90, 15);
    add(this.m_jContactComm);
    this.m_jContactComm.setBounds(110, 190, 160, 19);
    this.jLabel5.setText("Facturación");
    add(this.jLabel5);
    this.jLabel5.setBounds(290, 190, 90, 15);
    add(this.m_jContactFact);
    this.m_jContactFact.setBounds(380, 190, 160, 19);
    this.jLabel6.setText("Forma de pago");
    add(this.jLabel6);
    this.jLabel6.setBounds(20, 340, 90, 15);
    add(this.m_jPayRule);
    this.m_jPayRule.setBounds(110, 340, 160, 19);
    this.jLabel7.setText("Nº de fax");
    add(this.jLabel7);
    this.jLabel7.setBounds(20, 250, 90, 15);
    add(this.m_jFaxNumber);
    this.m_jFaxNumber.setBounds(110, 250, 160, 19);
    this.jLabel8.setText("Nº de teléfono");
    add(this.jLabel8);
    this.jLabel8.setBounds(20, 220, 90, 15);
    add(this.m_jPhoneNumber);
    this.m_jPhoneNumber.setBounds(110, 220, 160, 19);
    this.jLabel9.setText("Nº de móvil");
    add(this.jLabel9);
    this.jLabel9.setBounds(290, 220, 90, 15);
    add(this.m_jMobileNumber);
    this.m_jMobileNumber.setBounds(380, 220, 160, 19);
    this.jLabel10.setText("E Mail");
    add(this.jLabel10);
    this.jLabel10.setBounds(290, 250, 90, 15);
    add(this.m_jEMail);
    this.m_jEMail.setBounds(380, 250, 160, 19);
    this.jLabel11.setText("Página web");
    add(this.jLabel11);
    this.jLabel11.setBounds(20, 280, 90, 15);
    add(this.m_jWebPage);
    this.m_jWebPage.setBounds(110, 280, 270, 19);
    this.jLabel12.setText("Notas");
    add(this.jLabel12);
    this.jLabel12.setBounds(20, 410, 90, 15);
    this.jLabel13.setText("Dirección");
    add(this.jLabel13);
    this.jLabel13.setBounds(20, 80, 90, 15);
    this.jScrollPane1.setViewportView(this.m_jNotes);
    add(this.jScrollPane1);
    this.jScrollPane1.setBounds(110, 410, 270, 70);
    this.jScrollPane2.setViewportView(this.m_jAddress);
    add(this.jScrollPane2);
    this.jScrollPane2.setBounds(110, 80, 270, 70);
    this.jLabel14.setText("Contacto");
    this.jLabel14.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(0, 0, 0)));
    add(this.jLabel14);
    this.jLabel14.setBounds(20, 160, 520, 16);
    this.jLabel15.setText("Pagos");
    this.jLabel15.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(0, 0, 0)));
    add(this.jLabel15);
    this.jLabel15.setBounds(20, 310, 520, 16);
    this.jLabel16.setText("Notas");
    this.jLabel16.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(0, 0, 0)));
    add(this.jLabel16);
    this.jLabel16.setBounds(20, 380, 520, 16);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.thirdparties.ThirdPartiesView
 * JD-Core Version:    0.6.0
 */